﻿using Comm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CJGL
{
   public static class ClsParmart
    {
        //延时停止输送线
        public static string YCTZ { get; set; }
        public static string scanner_ip1 { get; set; }
        public static string scanner_port1 { get; set; }
        public static string scanner_ip2 { get; set; }
        public static string scanner_port2 { get; set; }
        public static string alert_prot { get; set; }
        public static string Baudrate { get; set; }
        public static string Alter_time1 { get; set; }
        public static string Alter_time2 { get; set; }
        public static string Alter_time3 { get; set; }
        public static string TCYS1 { get; set; }
        public static string TCYS2 { get; set; }
        public static string SelProId { get; set; }
        public static string ProCount { get; set; }
        public static string SCYS { get; set; }
        public static string cboprint1 { get; set; }
        public static string PrintCount { get; set; }
        public static string PrintNumber { get; set; }

        //产品类别
        public static string ProductCategory { get; set; }
        //包装类别
        public static string PackCategory { get; set; }
        //产品ID
        public static string ProId { get; set; }
        //暂停保持时间
        public static string ZTBC { get; set; }
        public static void LoadPar()
        {
            //赋值文件配置
            scanner_ip1 = XML.read("scanner_ip1", "p.xml");
            scanner_port1 = XML.read("scanner_port1", "p.xml");
            scanner_ip2 = XML.read("scanner_ip2", "p.xml");
            scanner_port2 = XML.read("scanner_port2", "p.xml");
            alert_prot = XML.read("alert_prot", "p.xml");
            Baudrate = XML.read("Baudrate", "p.xml");
            Alter_time1 = XML.read("Alter_time1", "p.xml");
            Alter_time2 = XML.read("Alter_time2", "p.xml");
            Alter_time3 = XML.read("Alter_time3", "p.xml");
            TCYS1 = XML.read("TCYS1", "p.xml");
            TCYS2 = XML.read("TCYS2", "p.xml");
            SCYS = XML.read("SCYS", "p.xml");
            YCTZ = XML.read("YCTZ", "p.xml");
            cboprint1 = XML.read("cboprint1", "p.xml");
            PrintCount = XML.read("PrintCount", "p.xml");
            ZTBC = XML.read("ZTBC", "p.xml");
            PrintNumber = XML.read("PrintNumber", "p.xml");
            if(String.IsNullOrEmpty(PrintNumber))
            {
                PrintCount = "1";
            }

            ProductCategory = XML.read("ProductCategory", "p.xml");
            PackCategory = XML.read("PackCategory", "p.xml");
            ProId = XML.read("ProId", "p.xml");
        }
    }
}
